
#pragma once
// #pragma comment(lib, "/usr/local/lib/libbreakpad.a")
#include "client/linux/handler/exception_handler.h"

static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor,
                         void *context, bool succeeded) {
  std::cout << "Dump path:" << descriptor.path() << std::endl;

  return succeeded;
}

void crash() {
  int *a = nullptr;
  *a = 1;
}

void testDump() {
  google_breakpad::MinidumpDescriptor descriptor("/tmp");
  google_breakpad::ExceptionHandler eh(descriptor, nullptr, dumpCallback,
                                       nullptr, true, -1);
  crash();

  return;
}